package com.andaily.domain.thing.handler;

import com.andaily.domain.user.User;
import com.andaily.infrastructure.support.LogHelper;

import java.util.List;

/**
 * Date: 13-7-19
 *
 * @author Shengzhao Li
 */
public class AutoStartThingHandler {

    private static LogHelper log = LogHelper.create(AutoStartThingHandler.class);

    private AutoStartThingUserResolver autoStartThingUserResolver = new AutoStartThingUserResolver();
    private UserAutoStartThingHandler userAutoStartThingHandler = new UserAutoStartThingHandler();

    public AutoStartThingHandler() {
    }

    public void handle() {
        List<User> users = autoStartThingUserResolver.resolve();
        for (User user : users) {
            userAutoStartThingHandler.handle(user);
        }
        log.info("Auto start thing handler execute successful, reference users: " + users);
    }
}
